'''
常用的控制浏览器的方法：
(1)back()					浏览器后退
(2)forward()					浏览器前进
(3)refresh() 					浏览器刷新
(4)minimize_window() 		浏览器最小化
(5)maximize_window() 		浏览器最大化
(6)set_window_size(480, 800)	设置浏览器宽 480、高 800 显示(参数数字为像素点
(7)get_window_size()	获取浏览器宽

'''

from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options

driver = webdriver.Chrome(options=options)

driver.get(r'https://www.baidu.com/')
sleep(1)
driver.get(r'https://news.baidu.com/')
sleep(1)

driver.back()
sleep(1)
driver.forward()
sleep(1)
driver.refresh()
sleep(1)
driver.minimize_window()
sleep(1)
driver.maximize_window()  # 常用
sleep(1)
driver.set_window_size(900, 600)
sleep(1)
print(driver.get_window_size())
sleep(1)

driver.quit()




